package com.ruicar.afs.cloud.afscase.channel.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruicar.afs.cloud.afscase.channel.condition.CarDealerCondition;
import com.ruicar.afs.cloud.afscase.channel.entity.CommonCarDealer;
import com.ruicar.afs.cloud.afscase.channel.vo.AllCarDealerVo;
import com.ruicar.afs.cloud.afscase.channel.vo.CarDealerVo;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: sang jian
 * @date: 2020/5/14 10:53
 * @description:
 */

public interface CarDealerMapper extends BaseMapper<CommonCarDealer> {

    /**
     * 根据登录账户和车商类型获取车商列表
     */
    ArrayList<CarDealerVo> getDirectCarDealersByUserId(@Param("userId") String userId, @Param("cardealerType") String cardealerType, @Param("businessType") String businessType);

    ArrayList<CarDealerVo> getCommonCarDealersByUserId(@Param("userId") String userId, @Param("cardealerType") String cardealerType);


    IPage<AllCarDealerVo> getAllCarDealers(Page page, @Param("query") CarDealerCondition condition);



    ArrayList<CarDealerVo> getCommonCarDealersByChannelId(@Param("channelId") String channelId, @Param("cardealerType") String cardealerType);

    ArrayList<CarDealerVo> getDirectCarDealersByUserIds(@Param("userIds") List<String> userIds, @Param("cardealerType") String cardealerType, @Param("businessType") String businessType);

    ArrayList<CarDealerVo> getCommonCarDealersByUserIds(@Param("userIds") List<String> userIds, @Param("cardealerType") String cardealerType);


}
